package concurrent;

import java.util.concurrent.atomic.AtomicInteger;

public class Atomic {

      static AtomicInteger count;

    static  void add(){

        for (int i = 0; i < 10000; i++) {
            count.incrementAndGet();
        }
        System.out.println(Thread.currentThread());
        System.out.println(count.get());
    }
    public static void main(String[] args) {

        for (int i = 0; i < 10; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    add();
                }
            }).start();
        }

    }
}
